package com.yenlien.traceyun.usercenter;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableScheduling;

import javax.sql.DataSource;

/**
 * @author: bigwangy@sina.com
 * @create: 2020-03-04
 * @description:通过 Spring Cloud 原生注解 @EnableDiscoveryClient 开启服务注册发现功能，不能用EnableEurekaClient该注解只能用于Eureka
 **/
@EnableFeignClients
@EnableScheduling
@EnableDiscoveryClient
@SpringBootApplication(scanBasePackages = "com.yenlien.traceyun")
public class UserCenterApplication implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication.run(UserCenterApplication.class, args);
    }

    @Autowired
    DataSource dataSource;

    // 查看使用的数据库连接池
    @Override
    public void run(String... args){
        System.out.println("DATASOURCE = " + dataSource);
    }
}